#ifndef RBTREE_HPP
#define RBTREE_HPP

typedef struct jsw_node {
   int red;
   unsigned long data;
   jsw_node *link[2];
} sRBNode_t, *spRBNode_t;

typedef struct jsw_tree {
  spRBNode_t root;
} sRBTree_t, *spRBTree_t;

int is_red ( spRBNode_t root );
spRBNode_t jsw_single ( spRBNode_t root, int dir );
spRBNode_t jsw_double ( spRBNode_t root, int dir );
spRBNode_t make_node ( unsigned long data );
spRBNode_t find_node (spRBNode_t root, unsigned long data );
spRBNode_t jsw_insert_r ( spRBNode_t root, unsigned long data );
int jsw_insert ( spRBTree_t tree, unsigned long data );

//int jsw_insert ( spRBTree_t tree, int data );

#endif // #ifndef RBTREE_HPP

